<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('获取审核本级回复未处理工单T')"/>
</head>
<body style="background-color: #F4F6FA">
<div class="main-content" style="margin: 0;padding: 0">
    <form id="form-user-add" class="form-horizontal" style="background-color: #F4F6FA">
        <!--工单主题,工单编号,工单性质...-->
        <div class="col-sm-12">
            <label class="col-sm-6 control-label spLBlue" style="margin: 20px 0 10px 0">总共还有<span class="spRed" id="remainCount"> [[${num}]] </span>条数据未获取</label>
        </div>
        <div class="col-sm-12">
            <div class="form-group">
                <label class="col-sm-6 control-label" style="float: left;padding-top: 7px;"><span class="spRed">随机</span>获取条数：</label>
                <div class="col-sm-6" style="float: left;">
                    <select  id="num" style="width: 200px;"
                            class="form-control formSelect">
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="20">20</option>
                        <option value="50">50</option>
                    </select>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<script>
    var prefix = ctx + "gaoxin/system/mTelWF";
    function submitHandler() {
        let val = $('#num option:selected').val();
        $.ajax({
            url: prefix + '/cmnFile/getAWaitPeerReplyTCount',
            type: 'post',
            dataType: 'json',
            data: '',
            success: function (res){
                if (res.data > 0){
                    let config = {
                        url: prefix + '/cmnFile/getAWaitPeerReplyList',
                        type: "post",
                        dataType: "json",
                        data: {num:val},
                        success: function (result) {
                            $.modal.msgSuccess(result.msg);
                            $.modal.close();
                            refreshTListAuditPeerReply();
                        }
                    };
                    $.ajax(config);
                }else{
                    $.modal.msgWarning("暂无待获取工单！")
                    $.modal.close();
                    refreshTListAuditPeerReply();
                }
            },
            error: function (res){
                $.modal.msgError("请刷新后再次获取！")
            }
        })
    }

    // 刷新审核本级回复
    function refreshTListAuditPeerReply() {
        var navFrame = $('.NAP_iframe[data-id="/gaoxin/system/cmnTab/tAuditPeerReplyTab"]', parent.document).contents().find('#navFrame')[0];
        navFrame.contentWindow.$.modal.reload();
    }
</script>
</body>
</html>

